import request from '@/utils/request'
const prefixUrl = '/api/personal'

// 用户信息
export function getInfo() {
	return request({
		url: `${prefixUrl}/userInfo`,
		method: 'get'
	})
}

/**
 * 修改资料
 * @param {Object} data
 */
export function editInfo(data) {
	return request({
		url: `${prefixUrl}/edit`,
		method: 'put',
		data: data
	})
}

/**
 * 教练入驻
 * @param {Object} data
 */
export function joinCoach(data) {
	return request({
		url: `${prefixUrl}/enterCoach`,
		method: 'post',
		data: data
	})
}

/**
 * 修改密码
 * @param {Object} params
 */
export function updatePwd(params) {
	return request({
		url: '/system/user/profile/updatePwd',
		method: 'PUT',
		params: params
	})
}